[mirrors]
http://www.rsyslog.com/download/files/download/rsyslog/rsyslog-7.6.6.tar.gz

[vars]
filesize=3027663
sha512=851b5f437e3bad60951d00a7411f787eae5203c640918fc27052801b93eb261e69981d3e05b5cee914b96f3d81b26f00a4542fd68542b2435893893475b2e6b4

[deps]
libressl
libuuid
libestr
liblogging
json-c
gnutls
librelp

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
patch -p1 < "$K"/rsyslog-fcntl.patch
patch -p1 < "$K"/rsyslog-gnutls.patch
sed -i 's@^extern char \*strdup.*@@' grammar/lexer.c
CPPFLAGS="-DHAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION -D_GNU_SOURCE" \
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure --prefix="$butch_prefix" $xconfflags --sbindir="$butch_prefix"/bin \
              --disable-mysql --disable-pgsql --disable-mail \
              --disable-snmp --disable-imjournal --disable-libgcrypt \
              --disable-omjournal --enable-imfile  \
              --enable-relp --enable-gnutls \
              --disable-generate-man-pages \
              ac_cv_func_malloc_0_nonnull=yes \
              ac_cv_func_realloc_0_nonnull=yes

make -j$MAKE_THREADS V=1
make DESTDIR="$butch_install_dir" install
install -D -m640 "$K"/rsyslog.conf "$butch_install_dir"/"$butch_prefix"/etc/rsyslog.conf

IS="$K"/bin/butch-install-service
"$IS" --down --log --force rsyslog "$K"/services/rsyslog
